import { load } from '/views/web/script.js'
load()

let id = new URL(location.href).searchParams.get('id')
let renderNews = async function () {
  let { title, author, content } = await fetch(
    `http://localhost:3000/news/${id}`
  ).then((res) => res.json())
  document.querySelector('#title').innerHTML = title
  document.querySelector('#author').innerHTML = '作者：' + author
  document.querySelector('#detail').innerHTML = content
}
renderNews()
